package com.Maykk.charStream;

import java.io.*;

/**
 * @ClassName: Demo02
 * @Description: TODO OutputStreamWriter 字符流练习
 * @Author: MaykkStar@163.com
 */
public class Demo02 {
    public static void main(String[] args) throws IOException {
//        FileOutputStream fos = new FileOutputStream("./Maykk.txt");
        OutputStreamWriter ow = new OutputStreamWriter(new FileOutputStream("./Maykk.txt"));

        ow.write("小马 Maykk");

        ow.close();
//        fos.close();
        System.out.println("============================");
//        FileInputStream fis = new FileInputStream("./Maykk.txt");
        InputStreamReader ir = new InputStreamReader(new FileInputStream("./Maykk.txt"));

        int by;
        while((by = ir.read()) != -1)
            System.out.print((char)by);

        ir.close();
//        fis.close();
    }
}
